<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>const声明常量 只读变量</title>
</head>
<body>

    <script>
        
        //1.声明之后不允许改变
        //2.一旦声明必须初始化，否则会报错

        const a = 1 ;
        a =3  //Uncaught TypeError: Assignment to constant variable
        

        





    </script>
    
</body>
</html>